package com.ruoyi.system.service.impl;

import java.util.List;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.system.domain.vo.WhPrintIntListVo;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.WhPrintLogMapper;
import com.ruoyi.system.domain.WhPrintLog;
import com.ruoyi.system.service.IWhPrintLogService;

import javax.annotation.Resource;

/**
 * 打印日志Service业务层处理
 *
 * @author ruoyi
 * @date 2023-03-12
 */
@Service
public class WhPrintLogServiceImpl implements IWhPrintLogService {

    @Resource
    private WhPrintLogMapper whPrintLogMapper;

    /**
     * 查询打印日志
     *
     * @param id 打印日志主键
     * @return 打印日志
     */
    @Override
    public WhPrintLog selectWhPrintLogById(Integer id) {
        return whPrintLogMapper.selectWhPrintLogById(id);
    }

    /**
     * 查询打印日志列表
     *
     * @param whPrintLog 打印日志
     * @return 打印日志
     */
    @Override
    public List<WhPrintLog> selectWhPrintLogList(WhPrintLog whPrintLog) {
        return whPrintLogMapper.selectWhPrintLogList(whPrintLog);
    }

    @Override
    public List<WhPrintIntListVo> findPrintLogList(WhPrintLog whPrintLog) {
        return whPrintLogMapper.findPrintLogList(whPrintLog);
    }

    /**
     * 新增打印日志
     *
     * @param whPrintLog 打印日志
     * @return 结果
     */
    @Override
    public int insertWhPrintLog(WhPrintLog whPrintLog) {
        whPrintLog.setCreateTime(DateUtils.getNowDate());
        return whPrintLogMapper.insertWhPrintLog(whPrintLog);
    }

    /**
     * 修改打印日志
     *
     * @param whPrintLog 打印日志
     * @return 结果
     */
    @Override
    public int updateWhPrintLog(WhPrintLog whPrintLog) {
        whPrintLog.setUpdateTime(DateUtils.getNowDate());
        return whPrintLogMapper.updateWhPrintLog(whPrintLog);
    }

    /**
     * 批量删除打印日志
     *
     * @param ids 需要删除的打印日志主键
     * @return 结果
     */
    @Override
    public int deleteWhPrintLogByIds(Integer[] ids) {
        return whPrintLogMapper.deleteWhPrintLogByIds(ids);
    }

    /**
     * 删除打印日志信息
     *
     * @param id 打印日志主键
     * @return 结果
     */
    @Override
    public int deleteWhPrintLogById(Integer id) {
        return whPrintLogMapper.deleteWhPrintLogById(id);
    }
}
